<template>
	<ve-dialog
		width="510px"
		title="删除提醒"
		:show.sync="isShow"
		:on-close="onCloseDialog"
	>
		<ve-content class="delete-dialog">
			<p v-show="isShowResourceTip" class="tip-title">当前有课程在使用该资源,删除会影响学员使用,请前往相关课程解除应用后再删除</p>
			<p v-show="isShowCardTip" class="tip-title">记忆闪卡在使用该资源，请解除应用后再删除</p>
			<div class="detail-link" type="text" @click="onResourceDetail">查看课程应用详情</div>
		</ve-content>
		<span slot="footer">
			<el-button type="primary" @click="onCloseDialog">
				确定
			</el-button>
		</span>
	</ve-dialog>
</template>
<script>
export default {
    props:{
        isShow: {
            type: Boolean,
            default: false
        },
        resourceId: {
            type: String,
            required: true
        },
        pageIndex: {
            type: Number,
            required: true
        },
        isShowResourceTip: {
            type: Boolean,
            default: false
        },
        isShowCardTip: {
            type: Boolean,
            default: false
        }
    },
    methods: {
        /**
         * @description 关闭弹窗
         */
        onCloseDialog() {
            this.$emit('close');
        },
        // 跳转到资源详情
        onResourceDetail() {
            nlapp.PageUtil.navigateToOnly('/rc/courseware/relevance-detail', {
                id: this.resourceId,
                pageIndex: this.pageIndex
            });
            this.onCloseDialog();
        }
    }
  };

</script>
<style lang="less" scoped>
    .delete-dialog{
        .tip-title{
            font-size: 14px;
            color: #3A3D4B;
            margin-bottom: 10px;
        }
        .tip{
            font-size: 13px;
            color: #909399;
            line-height: 19px;
        }
        .detail-link{
           text-decoration: underline;
           color: #ff4436;
           text-align: center;
           cursor: pointer;
        }
    }

</style>
